<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>2.v-if</title>
    <!-- 引入Vue -->
    <script type="text/javascript" src="../../vue.js"></script>
  </head>
  <body>
    <!-- 准备好一个容器-->
    <div id="demo">
      <h2>学校名称：{{school}}</h2>
      <h3>前端中的第{{n}}个框架是：</h3>
      <button @click="n+=1">点我n+1</button>
      <h4 v-if="n === 1">Angular</h4>
      <h4 v-else-if="n === 2">React</h4>
      <h4 v-else-if="n === 3">Vue</h4>
      <h4 v-else>未知</h4>
    </div>

    <script type="text/javascript">
      new Vue({
        el:'#demo',
        data:{
          school:'尚硅谷',
          n:1
        }
      })
    </script>
  </body>
</html>